[#ftl]
[#include "commonDef.ftl" /]
${pack_own}

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

${base_pack}.common.dto.ReqDTO;
${base_pack}.common.dto.ResDTO;
${base_pack}.controller.base.BaseController;
${pack_service}
[#-- 方法对象引入 --]
${import_method_class2!''}
${import_class!''}

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * ${data_main.moduleKeyName}
 * ${'@author '+author_str!"admin"}
 * @date ${date_str}
 */
@Api(value="${data_main.moduleKeyName}", tags ="${module_title+'-'+data_main.moduleKeyName}")
@Controller
@RequestMapping("${ControllerUrl(data_main)}")
public class ${name_own} extends BaseController {
    @Autowired
    private ${name_service} ${lname_service};
[#if resource_class??]
    ${resource_class}[#-- 载入类 --]
[/#if]
 
[#if data_method??]
[#list data_method as mdx]
[#if mdx.needFlag == '1']
    /** ${mdx.methodKeyName} */
    @ResponseBody
    @ApiOperation(value="${ControllerMethodTitle(data_main,mdx)}")
[#if ['getpage','getdetail','getlist']?seq_contains((mdx.methodOprType!'')) ]
    @RequestMapping(value="${mdx.methodUrl}", method = RequestMethod.POST)
    public ResDTO<${mdx.tags['name_res']}> ${ControllerMethodName(data_main,mdx)}(@RequestBody ReqDTO<${mdx.tags['name_req']}> reqInfo) throws Exception{
        ${mdx.tags['name_res']} data = ${lname_service}.get${ServiceMethodName(data_main,mdx)}(reqInfo);
        return successDATA(data);
    }
[#else]
    @RequestMapping(value="${mdx.methodUrl}", method = RequestMethod.POST)
    public ResDTO<${mdx.tags['name_res']}> ${ControllerMethodName(data_main,mdx)}(@RequestBody ReqDTO<${mdx.tags['name_req']}> reqInfo) throws Exception{
        ${mdx.tags['name_res']} data = ${lname_service}.do${ServiceMethodName(data_main,mdx)}(reqInfo);
        return successDATA(data);
    }
[/#if]
[/#if]

[/#list]
[/#if]
}
